<template>
  <div class="home">
    <p>姓名：{{obj.name}}</p>
    <p>描述：{{obj.ext}}</p>
  </div>
</template>

<script>
// @ is an alias to /src
import { mapActions,mapState } from 'vuex';
// mapActions actions 辅助函数
export default {
  name: 'Home',
  components: {

  },
  computed:{
    ...mapState(['obj'])
  },
  created() {
    this.init();
    // this.$store.commit()
  },
  methods: {
    // ...mapActions(['getData'])
    ...mapActions({
      init: 'getData'
    })
  },
}
</script>
